import requests
from lxml import etree
url ='https://www.baidu.com/'
head={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"}
r=requests.get(url=url,headers=head)
r.encoding=r.apparent_encoding
y=r.text
html_trr=etree.HTML(y)
doc=html_trr.xpath('//input[@id="su"]/@value')[0]
print(doc)



